package maze;

public class Barcode {

	int xPos;
	int yPos;
	String code;
	int direction;
	
	/**
	 * 
	 *
	 * @param xPos
	 * @param yPos
	 * @param BC The barcode to add, 8 chars: 0(black) or 1(white)
	 * @param direction 0: left to right, 1: top to bottom
	 */
	public Barcode(int xPos, int yPos, String BC, int direction){
		this.xPos = xPos;
		this.yPos = yPos;
		this.code =BC;
		this.direction = direction;
	}
	
	public int getX(){
		return xPos;
	}
	
	public int getY(){
		return yPos;
	}
	
	public String getCode(){
		return code;
	}
	
	public int getDirection(){
		return direction;
	}
	@Override
	public boolean equals(Object code){
	return ((Barcode)code).getCode().equals(this.getCode());	
	}
	public Direction getInDirection(){
		if(this.getDirection() == 1)
			return Direction.SOUTH;
		else
			return Direction.EAST;
	}
	
}
